package cn.ruc.dbiir.storm.generator.util;

import java.util.List;

import org.apache.kafka.clients.producer.Producer;

import com.google.common.collect.ImmutableList;

import clojure.main;

public class Config {

	
//	================================Kafka信息========================================================
	public static Producer<String, String> producer = null;//发送数据生成速率以及错误率，错误数据详情等
	public static final String TOPIC_RATE = "rateyun0";
	public static final String TOPIC_ERRWATER = "errwateryun0";
	
	public static String KAFKA = "100.115.142.160:9092";
//	public static String KAFKA = "202.112.113.71:9092";
	
//	public static String KAFKA = "127.0.0.1:9092";
	

	
	
	
	
	
	
//	================================数据库信息========================================================
	
	/**
	 * 数据库连接信息
	 */
//	public static final String DB_USER = "canal";
//	public static final String DB_URL = "jdbc:mysql://202.112.113.71:3306/markdb";
//	public static final String DB_PASSWD = "Cheng2017&";
	
//	public static final String DB_USER = "root";
//	public static final String DB_URL = "jdbc:mysql://127.0.0.1:3306/test";
//	public static final String DB_PASSWD = "Woshizzh123";
//	
//	public static final String DB_USER = "test";
//	public static final String DB_URL = "jdbc:mysql://100.115.142.161:6000/infodb";
//	public static final String DB_PASSWD = "test";
	
//	public static final String DB_USER = "test";
//	public static final String DB_URL = "jdbc:mysql://100.115.142.161:6000/markdb";
//	public static final String DB_PASSWD = "test";
	
	public static final String DB_USER = "test";
	public static final String DB_URL = "jdbc:mysql://100.115.142.160:8025/markdb";
	public static final String DB_PASSWD = "test";
	
	public static final String SQL_INFO = "UPDATE qinfo SET FBALANCE=FBALANCE+?,STATIS_DAY = ?,FDAY_SAVE_AMT=FDAY_SAVE_AMT+?,"
			+ "FMONTH_SAVE_AMT=FMONTH_SAVE_AMT+?,FLAST_SAVE_TIME=? WHERE fuin=?";
	
	
	
	

	
//	================================storm参数及数据生成相关信息====================================
	/**
	 * 设置每秒钟的生成数
	 */
	public static  Long TUPELS_PER_SEC = 20L;

	public static Double ERROR_RATE = 2.0;
	
	public static int ERROR_RATE_BASE = 1000;
	
	public static int ACC_RATE = 0;
	
	/**
	 * 上一次生成的tuple数
	 */
	public static long PRE_TUPLE_NUM = 0;
	
	public static String TOPOLOGY_NAME = "generator";
	/**
	 * spout/bolt的filed 数据格式声明
	 */
	public static final List<String> SCHEMA = ImmutableList.of("key","content");
	
	
	
	
	
	
	
//	================================流水和错误流水的存储地址====================================
	/**
	 * water，errwater path
	 */
//	public static String PATH_WATER = "/Users/mark/program/datagenOutput/errorOput/water.txt";// "/home/wtt/markcheng/output/test.txt";
//	public static String PATH_ERR_WATER = "/Users/mark/program/datagenOutput/errorOput/errWater.txt";
	
//	public static String PATH_WATER = "/Users/zzh/Desktop/output/water.txt";
//	public static String PATH_ERR_WATER = "/Users/zzh/Desktop/output/errWater.txt";
//	
//	public static String PATH_WATER = "/data/zzhstream/gene/water.txt";
//	public static String PATH_ERR_WATER = "/data/zzhstream/gene/errWater.txt";
	
	public static String PATH_WATER = "hdfs://100.107.157.225:9000/business/water.txt";
	public static String PATH_ERR_WATER = "hdfs://100.107.157.225:9000/business/errWater.txt";




	
}
